<script setup>

</script>

<template>
    <div style="width: 100vw; height: 100vh; overflow: hidden;">
      <div class="bg-box">
        <div class="layer1"></div>
        <div class="layer2"></div>
        <div class="layer3"></div>
        <div class="layer4"></div>
        <div class="layer5"></div>
      </div>
      <div class="login-page">
        <router-view v-slot="{ Component }">
          <transition name="el-fade-in-linear" mode="out-in">
            <component :is="Component" style="height: 100%"/>
          </transition>
        </router-view>
      </div>
    </div>
</template>

<style scoped lang="scss">
.bg-box {
  height: 100%;
  background: radial-gradient(ellipse at bottom, #1b2735 0%, #090a0f 100%);
  overflow: hidden;
}

@function getShadows($n) {
  $shadows: ();
  @for $i from 1 through $n {
    $x: random(100);
    $y: random(100);
    $shadows: append($shadows, $x + vw $y + vh #fff, comma);
  }
  @return $shadows;
}
$duration: 750s;
$count: 1000;
@for $i from 1 through 5 {
  $duration: floor($duration / 2);
  $count: floor($count / 2);
  .layer#{$i} {
    position: fixed;
    $size: #{floor($i / 2)}px;
    width: #{$size};
    height: #{$size};
    border-radius: 50%;
    box-shadow: getShadows($count);
    animation: moveup $duration linear infinite;
    &::after {
      content: '';
      position: fixed;
      width: inherit;
      height: inherit;
      left: 0;
      top: 100vh;
      border-radius: inherit;
      box-shadow: inherit;
    }
  }
}

@keyframes moveup {
  to {
    transform: translateY(-100vh);
  }
}

.login-page {
  position: absolute;
  left: 50vw;
  top: 50vh;
  transform: translate(-50%, -50%);
  width: 300px;
  height: 450px;
  border-radius: 10px;
  background-color: white;
}
</style>